package com.zswlib.netease.webapp.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;

import java.util.HashMap;
import java.util.Map;

 /**
  * BaseExceptionHandler.java, 2018/2/6. * * Copyright  Netease, Inc. All rights reserved. * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  */
public class BaseExceptionHandler {
    @ExceptionHandler
    public Map<String, Object> handleException(Exception e){
        HashMap<String, Object> map = new HashMap<String, Object>(3);
        map.put("message", e.getMessage());
        map.put("success", false);
        map.put("code", 0);
        return map;
    }
}